package com.hrm.exception;

import com.hrm.utils.entity.Result;
import com.hrm.utils.entity.StatusCode;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyExceptionHandler {
    //定义一个异常处理方法
    @ExceptionHandler
    public Result doError(Exception e){
        return new Result(false, StatusCode.ERROR, e.getMessage());
    }
}
